Skip to content

Stabilize compaction E2E tests#1314

Merged
stephentoub merged 2 commits into
mainfrom
stephentoub/fix-1227-compaction-skips
May 16, 2026
Merged

Stabilize compaction E2E tests#1314
stephentoub merged 2 commits into
mainfrom
stephentoub/fix-1227-compaction-skips

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

Compaction E2E coverage was still skipped in Node, Python, and Go even though the equivalent .NET and Rust tests had already been stabilized. This re-enables those skipped tests by using the same deterministic trigger flow across SDKs.

Summary

  • Re-enable the compaction E2E tests in Node, Python, and Go.
  • Register compaction event waiters before sending the prompts that trigger compaction.
  • Wait for session.compaction_start and a successful session.compaction_complete, matching the .NET/Rust behavior that ignores transient failed compaction attempts.
  • Verify the session can continue after compaction using the shared replay snapshot.

Validation

  • npx tsc --noEmit
  • npx vitest run --no-coverage test\e2e\compaction.e2e.test.ts
  • pytest e2e\test_compaction_e2e.py -v
  • go test .\internal\e2e\ -run TestCompactionE2E -v -timeout 300s

The required Opus 4.7 xhigh code-review/fix loop was run before this PR; it identified the need to wait for successful compaction completion events, which is included here.

Re-enable the compaction E2E coverage in Node, Python, and Go by matching the deterministic .NET/Rust flow: register event waiters before triggering compaction, wait for a successful compaction completion, and verify the post-compaction continuation path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 22:27
@stephentoub stephentoub requested a review from a team as a code owner May 16, 2026 22:27
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes and re-enables compaction E2E coverage for Node.js, Python, and Go, aligning them with existing .NET/Rust behavior around deterministic compaction triggering and successful completion events.

Changes:

  • Removes skips from compaction E2E tests.
  • Registers event waiters before triggering compaction.
  • Verifies successful compaction metadata and post-compaction session continuity.
Show a summary per file
File Description
python/e2e/test_compaction_e2e.py Re-enables Python compaction E2E and waits for start/successful complete events.
nodejs/test/e2e/compaction.e2e.test.ts Re-enables Node.js compaction E2E and adds successful completion assertions.
go/internal/e2e/compaction_e2e_test.go Re-enables Go compaction E2E and adds channel-based event waiting/assertions.

Copilot's findings

Comments suppressed due to low confidence (2)

nodejs/test/e2e/compaction.e2e.test.ts:65

  • The stabilized .NET and Rust compaction E2Es compare these summary tags case-insensitively (dotnet/test/E2E/CompactionE2ETests.cs:56-58, rust/tests/e2e/compaction.rs:84-87). Keeping these checks case-sensitive makes this test more brittle if a valid summary varies tag casing.
        const summary = completeEvent.data.summaryContent ?? "";
        expect(summary).toContain("<overview>");
        expect(summary).toContain("<history>");
        expect(summary).toContain("<checkpoint_title>");

go/internal/e2e/compaction_e2e_test.go:117

  • The stabilized .NET and Rust compaction E2Es compare these summary tags case-insensitively (dotnet/test/E2E/CompactionE2ETests.cs:56-58, rust/tests/e2e/compaction.rs:84-87). Keeping the Go checks case-sensitive makes this test more brittle if a valid summary varies tag casing.
		if !strings.Contains(summary, "<overview>") {
			t.Errorf("Expected summary to contain <overview>, got: %q", summary)
		}
		if !strings.Contains(summary, "<history>") {
			t.Errorf("Expected summary to contain <history>, got: %q", summary)
  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment thread nodejs/test/e2e/compaction.e2e.test.ts
Comment thread go/internal/e2e/compaction_e2e_test.go
Comment thread python/e2e/test_compaction_e2e.py Outdated
Add explicit compaction event timeouts in the Node test, surface session errors while waiting in the Go test, and make summary tag checks case-insensitive across SDKs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR re-enables the compaction E2E tests in Node.js, Python, and Go using the same deterministic pattern already established in the .NET and Rust reference implementations.

All 5 SDKs are now consistent on:

  • Registering event waiters before sending the prompts that trigger compaction (no race condition)
  • Filtering for success == true on compaction_complete events to tolerate transient failures
  • 60-second compaction timeout constant
  • Identical assertion set: conversationTokens > 0, compactionTokensUsed.inputTokens > 0, summary XML tags (<overview>, <history>, <checkpoint_title>), and the "kaedrith"/"dragon" context-preservation check

No cross-SDK consistency issues found.

Generated by SDK Consistency Review Agent for issue #1314 · ● 457.4K ·

@stephentoub stephentoub merged commit fc11032 into main May 16, 2026
34 checks passed
@stephentoub stephentoub deleted the stephentoub/fix-1227-compaction-skips branch May 16, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants